import org.junit.jupiter.api.Test;

import java.lang.reflect.Method;

public class test2 {
    @Test
    public void invokeInterfaceInfo() throws Exception{
        Class<?> aClass = Class.forName("com.zby.ApiClientSdk.client.NameApiClient");
        Object api = aClass.getConstructor(String.class, String.class).newInstance("asda","asadasaw");
        Method[] methods = aClass.getMethods();
        for (Method method:methods){
            Class<?>[] parameterTypes = method.getParameterTypes();
            if(parameterTypes.length==2&&method.getName()=="getUsernameByPosts"){
                Object hello = method.invoke(api, "hello", 18);
                System.out.println(hello.toString());
            }
        }
    }
}
